<?php
/**
 * The smallest part of the cube
 *
 * @package Cube
 * @since   Oct 19, 2006
 * @author  Christophe Thiriot
 */


/**
 * The class of the smallest part of the cube
 *
 * @abstract
 * @package Cube
*/
abstract class Cubie 
{
    const CENTER = 1;
    const EDGE   = 2;
    const CORNER = 3;

    /**
     * @var integer the origin position of the cube
     */
    protected $originPosition;

    /**
     * @var integer the type of cubie (number of faces)
     */
    private $cubieType;

    /**
     * Constructor
     */
    public function __construct($ctype = self::CENTER)
    {
        // Verify datatype
        if (is_numeric($ctype) && $ctype >= self::CENTER && $ctype <= self::CORNER) 
        {
            $this->cubieType = $ctype;
        } else 
        {
            throw new jException('Cubie::__construct : Bad cubie type. ' 
                                    . 'ctype = ' . $ctype);
        }
    }

    /**
     * getter
     * @final
     */
    final public function getOriginPosition()
    {
        return $this->originPosition;
    }

    /**
     * getter
     * @final
     */
    final public function getCubieType()
    {
        return $this->cubieType;
    }
}

?>
